<template>

		<uni-list>
		  <uni-list-item v-for="coin,index in coins" :title="coin.name" :rightText="coin.total_supply" link :to="'/pages/detail/detail?cid='+coin.id">
      </uni-list-item>
		</uni-list>
	
</template>

<script>
  import $config from '@/common/config.js'
	export default {
		data() {
			return {
				coins:[],
			}
		},
    onLoad() {
      this.query_list()
    },
		methods: {
        query_list(){
          let url = $config.url.coin_list
          uni.request({
            url:url,
            method: 'GET',
            success: ({data}) => {
              this.coins = data
              console.log(JSON.stringify(data))
            },
            fail: (err) => {
              console.log(JSON.stringify(err))
            },
            complete: () => {}
          });
        }
		}
	}
</script>

<style>
	
</style>
